package com.guo.model.function;

import lombok.*;

import java.util.ArrayList;
import java.util.List;

@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Student {
    private String name;
    private int age;

    @Singular
    private List<String> hobbies;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", hobbies=" + hobbies +
                '}';
    }

    public static void main(String[] args) {
        List<String> list = new ArrayList<>(){
            {
                add("唱");
                add("跳");
            }
        };
        Student stu = Student.builder()
                .hobbies(list)
                .build();
        System.out.println("stu = "+stu);
    }
}

